{extend name="layout/base" /} {block name="main"}
<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title am-fl">添加/编辑</div>
                    <div class="widget-function am-fr">
                        <a href="{:url('tadmin.auth.permission')}" class="am-icon-list" title="列表"></a>
                    </div>
                </div>
                <div class="widget-body am-fr">
                    <form class="am-form tpl-form-border-form" method="post" enctype="multipart/form-data" data-am-validator>
                        <div class="am-form-group">
                            <label for="user-name" class="am-u-sm-12 am-form-label am-text-left">权限名称 <span class="tpl-form-line-small-title">（必填）</span></label>
                            <div class="am-u-sm-12">
                                <input name="name" value="{$permission.name}" type="text" class="tpl-form-input am-margin-top-xs" placeholder="请输入账号" required>
                                <small>建议不超过16字。</small>
                            </div>
                        </div>
                        <div class="am-form-group">
                            <label for="user-name" class="am-u-sm-12 am-form-label am-text-left">HTTP方法 <span class="tpl-form-line-small-title">（必填）</span></label>
                            <div class="am-u-sm-12">
                                <select name="http_method" data-am-selected>
                                    <option {if $permission.http_method=='ALL' }selected{/if} value="ALL">ALL</option>
                                    <option {if $permission.http_method=='POST' }selected{/if} value="POST">POST</option>
                                    <option {if $permission.http_method=='PUT' }selected{/if} value="PUT">PUT</option>
                                    <option {if $permission.http_method=='DELETE' }selected{/if} value="DELETE">DELETE</option>
                                    <option {if $permission.http_method=='PATCH' }selected{/if} value="PATCH">PATCH</option>
                                    <option {if $permission.http_method=='OPTIONS' }selected{/if} value="OPTIONS">OPTIONS</option>
                                    <option {if $permission.http_method=='HEAD' }selected{/if} value="HEAD">HEAD</option>
                                </select>
                            </div>
                        </div>
                        <div class="am-form-group">
                            <label for="user-intro" class="am-u-sm-12 am-form-label  am-text-left">HTTP路径</label>
                            <div class="am-u-sm-12 am-margin-top-xs">
                                <textarea name="http_path" class="" rows="8" placeholder="输入HTTP路径" required>{$permission.http_path}</textarea>
                                <small>多个路径，每行一条</small>
                            </div>
                        </div>
                        <div class="am-form-group">
                            <div class="am-u-sm-12 am-u-sm-push-12">
                                <input name="id" value="{$permission.id}" type="hidden">
                                <button type="submit" class="am-btn am-btn-primary tpl-btn-bg-color-success ">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{/block}